package com.songcha.module_main.ui.dialog

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import com.songcha.library_common.ui.dialog.CustomDialog
import com.songcha.library_common.ui.view.CustomButton
import com.songcha.library_common.util.dp2px
import com.songcha.module_main.R

class AutoStrikeRewardDialog(context: Context,val onConfirm:()->Unit,val onCancel:()->Unit):CustomDialog(context) {
    init {
        custom(10f)
        setSize(320.dp2px(),220.dp2px())
    }

    override fun hasView(): Boolean {
        return true
    }

    override fun getView(root: ViewGroup): View? {
        val view = LayoutInflater.from(context).inflate(R.layout.main_dialog_auto_strike_reward,root,false)
        view.findViewById<ImageView>(R.id.main_btn_confirm).setOnClickListener {
            dismiss()
            onConfirm()
        }
        view.findViewById<CustomButton>(R.id.main_btn_cancel).setOnClickListener {
            dismiss()
            onCancel()
        }
        return view
    }
}